package com.inkyi.assistant.app.todolist.table;

import com.inkyi.framework.common.lang.InkParams;
import com.inkyi.framework.daqian.share.jtable.PkRow;

import java.io.Serializable;
import java.util.Vector;

public class TodoItem extends Vector<Object> implements PkRow {

    private final InkParams params = new InkParams();

    public static final String PARAM_GROUP_LIST = "param_group_list";

    private static final int IDX_ID = 0;
    private static final int IDX_IS_FINISH = 1;
    private static final int IDX_TITLE = 2;

    public TodoItem(Long id, Boolean isFinish, String title) {
        // 放入数组
        this.setSize(3);
        this.set(IDX_ID, id);
        this.set(IDX_IS_FINISH, isFinish);
        this.set(IDX_TITLE, title);
    }

    public Long getId() {
        return (Long) get(IDX_ID);
    }

    public void setId(Long id) {
        set(IDX_ID, id);
    }

    public String getTitle() {
        return (String) get(IDX_TITLE);
    }

    public void setTitle(String title) {
        set(IDX_TITLE, title);
    }

    public Boolean getFinish() {
        return (Boolean) get(IDX_IS_FINISH);
    }

    public void setFinish(Boolean finish) {
        set(IDX_IS_FINISH, finish);
    }

    public InkParams getParams() {
        return params;
    }

    @Override
    public Serializable getPk() {
        return (Long) get(IDX_ID);
    }
}
